package message

import "gitee.com/ameise84/e3log"

type RspHandler interface {
	OnResponse(Response)
}

type Message interface {
	SetID(id uint64)
	SetKind(Kind)
	SetToActor(toSrvID, toSSID, toCID string)
	SetMsg(protoc string, body []byte)
	SetRspHandler(RspHandler)
	BindContext(ctx any)
	ResponseMsg(string, []byte)
}

type Request interface {
	Response
	Context() any
	GetKind() Kind
	GetFromActor() *Source
	GetToActor() *Source
	ResponseForward(Response)
	ResponseMsg(string, []byte)
}

type Response interface {
	e3log.LogMarshaller
	GetMsgID() uint64
	GetProtocName() string
	GetBody() []byte
	ToJson() string
}
